#include <cstdlib>
#include <cctype>
#include "utils.h"

int sommeChiffre(std::string key) {
    int somme = 0;
    std::string tmp = "";
    for (int i = 0; i < key.length(); i++) {
        if (isdigit(key[i])) {
            tmp = key[i];
            somme += atoi(tmp.c_str());
        }
    }
    return somme;
}